<template>
  <div class="storyInfo" v-if="flag==true">
    <div class="return" @click="returnroute">X</div>
    <div class="info-item">
      <img :src ="this.dataList.cover?this.dataList.cover:''">
      <div class="item-title">
        <div class="title">{{ dataList.story_name }}</div>
        <div class="staus">
          <span class="finish">{{
            dataList.is_serial == 1 ? "连载中" : "已完结"
          }}</span
          ><span class="total">{{
            "(更新至第" +
            dataList.chapter_count +
            "/" +
            dataList.chapter_num +
            "章)"
          }}</span>
        </div>

        <div class="desc">{{ dataList.summary }}</div>
        <div class="author">
          {{ "By" + dataList.username }}
          <div class="price">
            <span class="turncolor">{{ dataList.price }}</span
            >胖币 
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return { flag: false ,dataList:[]};
  },
  props: {
    storyInfo: Object,
  },

  created(){
    this.flag=true
   
  },

  beforeDestory(){
    this.flag=false
  },

  methods:{
    returnroute(){
     this.$router.go(-1);
    }
  },
  watch:{
    storyInfo(){
       this.dataList=this.storyInfo
    }
  }

};
</script>

<style lang="scss" scoped>
 .return{
    position: fixed;
    top: 0;
    height: 70px;
    padding-left: 40px;
    line-height: 70px;
    font-size: 20px;
    background-color: #fff;
    width: 100vw;
  }
.info-item {
  display: flex;
  padding-left: 10px;
  padding-top: 30px;
 
  img {
    width: 100px;
    height: 120px;
  }

  .item-title {
    padding-left: 10px;
    display: flex;
    flex-direction: column;
    justify-content: space-around;

    .staus {
      font-size: 12px;

      .finish {
        display: inline-block;
        background-color: rgb(44, 120, 120);
        border-radius: 10px;
        height: 15px;
        width: 50px;
        color: white;
        text-align: center;
        line-height: 15px;
      }
      .total {
        padding-left: 10px;
      }
    }

    .desc {
      font-size: 12px;
      color: #777;
    }

    .author {
      display: flex;
      font-size: 12px;
      color: #777;
      justify-content:space-between;

      .turncolor{
        color: orange;
      }
    }
  }
}
</style>